package com.tsunami.authority.dto.auth;

import com.tsunami.enums.Sex;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户
 *
 * @author lx
 * @date 2021-10-28 14:03
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@Schema(description = "用户")
public class UserDTO implements Serializable {

    @Schema(description = "客户端ID")
    private String clientId;

    @Schema(description = "ID")
    private Long id;

    @Schema(description = "账号")
    @NotEmpty(message = "账号不能为空")
    @Length(max = 30, message = "账号长度不能超过30")
    private String account;

    @Schema(description = "姓名")
    @NotEmpty(message = "姓名不能为空")
    @Length(max = 50, message = "姓名长度不能超过50")
    private String name;

    @Schema(description = "组织ID")
    private Long orgId;

    @Schema(description = "岗位ID")
    private Long stationId;

    @Schema(description = "邮箱")
    @Length(max = 255, message = "邮箱长度不能超过255")
    private String email;

    @Schema(description = "手机号")
    @Length(max = 20, message = "手机长度不能超过20")
    private String mobile;

    @Schema(description = "性别")
    private Sex sex;

    @Schema(description = "启用状态")
    private String status;

    @Schema(description = "用户类型")
    private String type;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "工作描述")
    private String workDescribe;

    @Schema(description = "最后登录时间")
    private LocalDateTime lastLoginTime;
}
